package com.gzwh.v1.sysapi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.transaction.annotation.EnableTransactionManagement;


/**
 * @SpringBootApplication 代替@Configuration,@EnableAutoConfiguration,@ComponentScan
 * @ServletComponentScan 可以自定义servlet，否则无法访问webservlet，druid监控页面使用
 */

@SpringBootApplication
@ServletComponentScan
@EnableTransactionManagement // 启注解事务管理
public class SysapiApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(this.getClass());
    }

    public static void main(String[] args) {
        SpringApplication.run(SysapiApplication.class, args);
    }

}
